import simpleSpatialModel
import pylab as pl
import time
#import psyco

#psyco.full()

simpleSpatialModel.params['beta'] = 1.5
simpleSpatialModel.params['ieSize'] = 10
simpleSpatialModel.params['sc'] = 0.4
simpleSpatialModel.params['nX'] = 10
simpleSpatialModel.params['nY'] = 10
simpleSpatialModel.params['nSize'] = 500
simpleSpatialModel.params['gw'] = -2.0
simpleSpatialModel.params['gb'] = 0.0 # -.5
simpleSpatialModel.params['rho'] = 3.0
simpleSpatialModel.params['sc'] = .2

#noSegOutbreak = 0
#for i in xrange(100):
#    print(i)
#    x = simpleSpatialModel.model(simpleSpatialModel.params)
#    x.setupSocialModel()
#    noSegOutbreak += x.isOutbreak()
#    
#print('numNoSegOutbreak', noSegOutbreak)
#
#segOutbreak = 0
#
#simpleSpatialModel.params['gw'] = -2.0
#
#
#for i in xrange(100):
#    print(i)
#    x = simpleSpatialModel.model(simpleSpatialModel.params)
#    x.setupSocialModel()
#    segOutbreak += x.isOutbreak()
#    
#print('segOutbreak', segOutbreak)


a = time.time()
x = simpleSpatialModel.model(simpleSpatialModel.params)
x.setupSocialModel()
z=x.runUntilDieOut(printOut = False)
b = time.time()

simpleSpatialModel.panelPcolorPlot(z[5])
c = time.time()

print(c-b,b-a)


